package com.zhl.methods_reference6;

import com.zhl.arrays4.Student;

public class CompareByData {
    public static int compare(Student o1, Student o2) {
        return o1.getAge() - o2.getAge();   //升序
    }

    public int compareByAge(Student o1, Student o2) {
        return o2.getAge() - o1.getAge();   //降序
    }
}
